//
//  DXWHTTPManager.m
//  pandaTV
//
//  Created by 淡馨慰 on 16/9/23.
//  Copyright © 2016年 淡馨慰. All rights reserved.
//

#import "DXWHTTPManager.h"
#import <AFNetworking/AFNetworking.h>

@implementation DXWHTTPManager

/**
 使用get方式发送网络请求
 */
+ (void)loadDataWithGetURL:(NSString *)url parameters:(NSDictionary *)dict
{
    //1. 创建会话管理者
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//    NSSet *set = [NSSet setWithObject:@"text/html"];
//    manager.responseSerializer.acceptableContentTypes = set;
    
    //2. 发送GET请求
    [manager GET:url parameters:dict  progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSLog(@"success - %@ - %@",responseObject,[responseObject class]);
//        [responseObject writeToFile:@"/Users/milkteacat/Desktop/淡/蛙喵项目练习/熊猫TV/youxi.plist" atomically:YES];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"failure - %@",error);
    }];
}

@end
